/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package core;

import java.util.Collection;

import core.environment.Singleton;
import core.environment.fVector;

/**
 * A singleton class encapsulating all the predicted, observed data of a group 
 * @author Sergey and Julia
 *
 */
@Singleton
public class GroupObservedPredictedHolder {
	/**
	 * Predicted Vector
	 */
	private Collection<Object> PredictedV;
	/**
	 * Observed Vector
	 */
	private Collection<Object> ObservedV;
	/**
	 * A single instance of this class
	 */
	private static GroupObservedPredictedHolder instance = new GroupObservedPredictedHolder();
	
	private GroupObservedPredictedHolder() {
		this.PredictedV = new fVector();
		this.ObservedV = new fVector();
	}
	
	/**
	 * Standard singleton method
	 * @return single instance of the class 
	 */
	public static GroupObservedPredictedHolder getInstance() {
		return instance;
	}
	
	/**
	 * Allows batch adding of observed, predicted.
	 * Assume they are equal sized
	 * @param Observed vector of observed data
	 * @param Predicted vector of predicted data
	 */
	public void addPredictedObserved(Collection<Object> Observed, Collection<Object> Predicted) {
		this.PredictedV.addAll(Predicted);
		this.ObservedV.addAll(Observed);
	}

	/**
	 * Will clear the storage of data
	 */
	public void clear() {
		this.PredictedV.clear();
		this.ObservedV.clear();
	}

	/**
	 * Getter for the predicted
	 * @return  reference to storage of predicted data
	 */
	public Collection<Object> getPredicted() {
		return this.PredictedV;
	}
	
	/**
	 * Getter for the observed
	 * @return  reference to storage of observed data
	 */
	public Collection<Object> getObserved() {
		return this.ObservedV;
	}

}
